home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_130 / hp / hp_user_inputs.include < prev    next >
Text File  |  1992-05-06  |  2KB  |  88 lines

  1. /*--------------------------------------------*/
  2. /*                                            */
  3. /*    Filename:  hp_user_inputs.include       */
  4. /*                                            */
  5. /*    Contains C source code for routines     */
  6. /*    TweakDisplay, BeepHpDisplay, KeyCode    */
  7. /*    and GadgetPoked, which are used by      */
  8. /*             routine hp.c                   */
  9. /*                                            */
  10. /*--------------------------------------------*/
  11. TweakDisplay()
  12. {
  13.   if ( inkey == 61 ) display_red   = (display_red   + 1) % 16;
  14.   if ( inkey == 62 ) display_green = (display_green + 1) % 16;
  15.   if ( inkey == 63 ) display_blue  = (display_blue  + 1) % 16;
  16.  
  17.   SetRGB4( vp, SCREENCOLOR, display_red, display_green, display_blue );
  18. }
  19. /*-------------------------------------------------------------------*/
  20. BeepHpDisplay()
  21. { int timer, nothing;
  22.  
  23.   SetRGB4( vp, SCREENCOLOR, 15, 9, 0 );
  24.  
  25.   for( timer = 1; timer <= 5000; timer++) nothing = 0;
  26.  
  27.   SetRGB4( vp, SCREENCOLOR, display_red, display_green, display_blue );
  28.  
  29. }
  30. /*-------------------------------------------------------------------*/
  31. KeyCode()
  32. {
  33.   int row, col, hue, x, y, key;
  34.  
  35.   x = hp_window -> MouseX;
  36.   y = hp_window -> MouseY;
  37.  
  38.   hue = ReadPixel( rp, x, y );
  39.  
  40.   if ( hue == 0 ) return(0);
  41.  
  42.   row = (y -  73) / 17;
  43.  
  44.   if ( (row >= 0) && (row <= 2) && (x >= 390) && (x <= 593) ) {
  45.     col = (x - 390) / 56;
  46.     key = row * 4 + col + 1;
  47.     return(key);           }
  48.  
  49.   if ( (row >= 0) && (row <= 5) && (x >= 46) && (x <= 361) ) {
  50.     col = (x - 46) / 56;
  51.     key = row * 6 + col + 13;
  52.     return(key);            }
  53.  
  54.   if ( row == 3 ) {
  55.     if ( (x >= 414) && (x <= 449) ) return(49);
  56.     if ( (x >= 477) && (x <= 512) ) return(50);
  57.     if ( (x >= 558) && (x <= 593) ) return(51); }
  58.  
  59.   if ( (row == 4) && (x >= 446) && (x <= 514) ) return(52);
  60.   if ( (row == 5) && (x >= 429) && (x <= 464) ) return(53);
  61.   if ( (row == 5) && (x >= 494) && (x <= 529) ) return(54);
  62.   if ( (row == 5) && (x >= 558) && (x <= 593) ) return(64);
  63.  
  64.   if (row == 6) {
  65.     col = (x-46) / 97;
  66.     key = 55 + col;
  67.     return(key); }
  68.  
  69.   if ( hue == 6 ) return(61);
  70.   if ( hue == 7 ) return(62);
  71.   if ( hue == 4 ) return(63);
  72.  
  73.   return(0);
  74.  
  75. }
  76. /*--------------------------------------------------------*/
  77. BOOL GadgetPoked()
  78. {
  79.   message = GetMsg( hp_window -> UserPort );
  80.  
  81.   if ( message == NULL ) return(FALSE);
  82.  
  83.   if ( message -> Class == CLOSEWINDOW )
  84.     return(TRUE);
  85.   else
  86.     return(FALSE);
  87. }
  88.